<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />

<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/btn.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/icon.css" />
<link rel="Stylesheet" href="${aier_css_url}social/module/emotion.css" />
<link rel="Stylesheet" href="${aier_css_url}social/module/homeside.css" />
<link rel="stylesheet" href="${aier_css_url}social/user/userMessage/usermessage.css" />


<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript"
	src="${aier_js_url}emotion/xxsemotion.2.js"></script>
<script type="text/javascript" src="${aier_js_url}trantime/jquery-aier.js"></script>

</head>
<body>

	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user" executeResult="true"></s:action>
	<!-- 顶栏结束 -->

	<!-- 主区域 -->

	<div class="window-content">

		<!-- wrap  -->
		
		<div class="wrap wrap-msg wrap-message wrap-tri-col clearfix">

			<!-- 主侧栏 -->
			<s:action name="usermessage_msgSide" namespace="/user" executeResult="true"></s:action>


			<!-- 主区域 (右  -->
			<div class="msg-main clearfix">
				<div class="msg-stream">

					<div class="msg-title msg-title">
						<div class="group">与我相关</div>
					</div>
					
					<div class="msg-list msg-list-default clearfix">
                        

						<div class="msg-item type-special" data-url="${aier_url}user/usermessage_userMessageSpecial.shtml">

							<div class="msg-avatar icon-2-at"></div>
							<div class="msg-content">
								<div class="title">提到我的</div>
								    <div class="text" id="message1"></div>
								
							</div>
							<div class="msg-date msg-date-default" data-stamp="1475936725000"></div>

						</div>


						<div class="msg-item type-special" data-url="${aier_url}user/usermessage_userMessageComment.shtml">

							<div class="msg-avatar icon-2-comment"></div>
							<div class="msg-content">
								<div class="title">评论</div>
								<div class="text" id="message2"></div>
							</div>
							<div class="msg-date msg-date-default" data-stamp="1475936725000"></div>

						</div>

						<div class="msg-item type-special" data-url="${aier_url}user/usermessage_userMessagePraise.shtml">

							<div class="msg-avatar icon-2-praise"></div>
							<div class="msg-content">
								<div class="title">赞</div>
								<div class="text" id="message3"></div>
							</div>
							<div class="msg-date msg-date-default" data-stamp="1475936725000"></div>

						</div>

						<div class="msg-item type-special" data-url="${aier_url}user/usermessage_userMessageLetter.shtml"> 

							<div class="msg-avatar icon-2-letter"></div>
							<div class="msg-content">
								<div class="title">私信</div>
								<div class="text" id="message4"></div>
							</div>
							<div class="msg-date msg-date-default" data-stamp="1475936725000"></div>

						</div>

						<div class="msg-item type-special" data-url="${aier_url}user/usermessage_userMessageNotice.shtml">

							<div class="msg-avatar icon-2-notice"></div>
							<div class="msg-content">
								<div class="title">通知</div>
								<div class="text" id="message5"></div>
							</div>
							<div class="msg-date msg-date-default" data-stamp="1475936725000"></div>

						</div>
					</div>



				</div>

                <!-- 右栏 -->
                <s:action name="userhomecomm_homeRight" namespace="/user" executeResult="true"></s:action>
			</div>

			<!-- 回到顶部 -->
			<s:action name="userhomecomm_backToTop" namespace="/user" executeResult="true"></s:action>
			<!-- 回到顶部结束  -->

	</div>
	<!-- footer copyright -->
	<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
	<!-- /footer copyright -->
</div>

<script type="text/javascript">
    $('.msg-item').click(function(){
        window.location = $(this).attr('data-url');
    });
                
    $(document).ready(function() {
        // 获取与我相关总列表
        var fun=function(data){
            if(data.s==1){
                $("#message1").html(data.messageList[0]);
                $("#message2").html(data.messageList[1]);
                $("#message3").html(data.messageList[2]);
                $("#message4").html(data.messageList[3]);
                $("#message5").html(data.messageList[4]);
                
                $('.msg-list .text').each(function(){
                	$(this).tranText({
                		emotionUrl: '${aier_js_url}trantime/emotions.js'
                	});
                });
            }
        };
        exeAjax(
             ajaxUrl("${aier_url}${aier_urijs}usermessage_searchNewMessage${aier_suffix}"),
             fun,{
        });
    });
    
    $(document).ready(function() {
      
        // 获取关注分组
        var fun=function(data){
            if(data.s==1){
                var c = "";
                for (var i=0;i<data.fgList.length;i++) {
                    if (data.fgList[i].name == "特别关注") {
                        c += "<div class='tab-normal'><a class='btn' href='${aier_url}user/userhomeforums_homeForums.shtml?fgid="+data.fgList[i].fgid+"'><em class='icon-1 icon-1-teguan'></em><span>"+data.fgList[i].name+"</span></a></div>";
                    } else {
                        c += "<div class='tab-normal'><a class='btn' href='${aier_url}user/userhomeforums_homeForums.shtml?fgid="+data.fgList[i].fgid+"'><em class='icon-1 icon-1-weifen'></em><span>"+data.fgList[i].name+"</span></a></div>";
                    }
                    
                }
                $("#group").html(c);
                
            }
        };
        exeAjax(
             ajaxUrl("${aier_url}${aier_urijs}usermyfollow_searchFollowGroup${aier_suffix}"),
             fun,{
        });
    });
    
    // 跳转到家校联系薄
    function hsConBook() {
        // 判断是否付费

        // 判断身份（家长或老师）

        // 教师（tid）
        //window.location.href = "${aier_url}user/userhscb_userTeaHSConBook.shtml?tid=2&&cid=1";
        var fun = function(data) {
            if (data.s == 1) {

                if (data.type == 0) {
                    $().message("您目前没有权利进入家校联系薄！");
                    return;
                } else if (data.type == 1 || data.type == 3) {
                    if (data.classList != null && data.classList.length > 0) {
                        window.location.href = "${aier_url}user/userhscb_userTeaHSConBook.shtml?cid="
                                + data.classList[0].cid +"&type="+data.type;
                    } else {
                        window.location.href = "${aier_url}user/userhscb_userTeaHSConBook.shtml?type="+data.type;
                    }

                } else if (data.type == 2) {
                    window.location.href = "${aier_url}user/userhscb_userChiHSConBook.shtml?type="+data.type;
                }

            }
        };
        exeAjax(
                ajaxUrl("${aier_url}${aier_urijs}userhscb_searchClassList${aier_suffix}"),
                fun, {});

    }
</script>

</body>
</html>